package com.binhai.role;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private RoleService roleService;

    //查询所有数据
    @RequestMapping("/getAllInfos.do")
    public List getAllInfos(){
        return roleService.getAllInfos();
    }

    //添加角色信息
    @RequestMapping("/saveInfo.do")
    public Map saveInfo(RoleBean role){
        return roleService.saveInfo(role);
    }
    //删除角色信息
    @RequestMapping("/deleteInfo.do")
    public Map deleteInfo(int id){
        return roleService.deleteInfo(id);
    }
    @RequestMapping("/getInfoById.do")
    public Map getInfoById(int id){
        return roleService.getInfoById(id);
    }
    @RequestMapping("/updateInfo.do")
    public Map updateInfo(RoleBean role){
        return roleService.updateInfo(role);
    }


}
